package testcases;

import java.util.ArrayList;
import java.util.Date;


/**Generates some reusable standard example objects for testing
 * 
 * @author Parul Sharma
 *
 */
public class ExampleGenerator {
	
	/**
	 * An arraylist of 7 random students
	 */
	public static ArrayList<Student> arraylistStudents(){
		
		ArrayList<Student> studentlist = new ArrayList<Student>();
		
		studentlist.add(new Student(007,"Jane","Somebody", new Date(), false, 10));
		studentlist.add(new Student(006,"Jane","Nobody", new Date(), false, 20));
		studentlist.add(new Student(005,"James","Somebody", new Date(), true, 30));
		studentlist.add(new Student(004,"James","Nobody", new Date(), true, 40));
		studentlist.add(new Student(003,"Busy","Busybody", new Date(), true, 50));
		studentlist.add(new Student(002,"Ann","Person", new Date(), false, 60));
		studentlist.add(new Student(001,"Ben","Guy", new Date(), true, 70));
		studentlist.add(new Student(007,"Karen","noname", new Date(), false, 10));
		studentlist.add(new Student(006,"Jane","Everybody", new Date(), false, 20));
		studentlist.add(new Student(005,"James","Somebody", new Date(), true, 30));
		studentlist.add(new Student(004,"Vincent W.","Xyz", new Date(), true, 40));
		studentlist.add(new Student(003,"Sir Andrew","Someone", new Date(), true, 50));
		studentlist.add(new Student(002,"A.","Person", new Date(), false, 60));
		studentlist.add(new Student(001,"Ben","Guy II", new Date(), true, 70));
		studentlist.add(new Student(007,"Bill","Somebody", new Date(), false, 10));
		studentlist.add(new Student(006,"Jane","Cloned Person", new Date(), false, 20));
		studentlist.add(new Student(005,"Jesus","Christ", new Date(), true, 30));
		studentlist.add(new Student(004,"James","Nobody", new Date(), true, 40));
		studentlist.add(new Student(003,"Busy","Busybody", new Date(), true, 50));
		studentlist.add(new Student(002,"Ann","Person", new Date(), false, 60));
		studentlist.add(new Student(001,"Ben","Guy", new Date(), true, 70));
		studentlist.add(new Student(007,"Abc","Def", new Date(), false, 10));
		studentlist.add(new Student(006,"Ghy","Jhk", new Date(), false, 20));
		studentlist.add(new Student(005,"A.","Student", new Date(), true, 30));
		studentlist.add(new Student(004,"Group","Member", new Date(), true, 40));
		studentlist.add(new Student(003,"Another","Person", new Date(), true, 50));
		studentlist.add(new Student(002,"Some","Person", new Date(), false, 60));
		studentlist.add(new Student(001,"Random","Human", new Date(), true, 70));
		return studentlist;
		
	}
	
	/**
	 * A 2d arraylist of random students
	 */
	public static ArrayList<ArrayList<Student>> arrayList2d() {
		ArrayList<ArrayList<Student>> student2dList = new ArrayList<ArrayList<Student>>();
		//populate lists, adding them to the main list
		ArrayList<Student> firstList = new ArrayList<Student>();
		firstList.add(new Student(00,"Student00","", new Date(), true, 0)); //this will be top-level node
		firstList.add(new Student(01,"Student01","", new Date(), true, 0)); //these will be its children
		firstList.add(new Student(02,"Student02","", new Date(), true, 0));		
		student2dList.add(firstList);
		
		ArrayList<Student> secondList = new ArrayList<Student>();
		secondList.add(new Student(10,"Student10","", new Date(), true, 0)); //top level
		secondList.add(new Student(11,"Student11","", new Date(), true, 0)); //child
		student2dList.add(secondList);
		
		ArrayList<Student> thirdList = new ArrayList<Student>();		
		thirdList.add(new Student(20,"Student20","", new Date(), true, 0)); //etc
		student2dList.add(thirdList);
		
		ArrayList<Student> emptyList = new ArrayList<Student>();	
		student2dList.add(emptyList);		
		
		ArrayList<Student> fifthList = ExampleGenerator.arraylistStudents();			
		student2dList.add(fifthList);	
		
		return student2dList;
	}
	
	public static ArrayList<Student> masseyStudents(){
		ArrayList<Student> students = new ArrayList<Student>();		
		students.add(new Student(001,"Parul","Sharma", new Date(), false, 100));
		students.add(new Student(002,"Dale","Halliwell", new Date(), true, 100));
		students.add(new Student(003,"Lucia","Stewart", new Date(), true, 100));
		students.add(new Student(004,"Amir","Bashir", new Date(), true, 100));
		students.add(new Student(004,"Sam","Cao", new Date(), true, 100));
		students.get(0).friends[0] = students.get(1);		
		students.get(1).friends[0] = students.get(0);
		students.get(0).friends[1] = students.get(2);
		students.get(0).bestFriend = students.get(4);
		students.get(1).bestFriend = students.get(4);
		return students;
	}
	
	public static ArrayList<Paper> paperArrayList(){
		ArrayList<Paper> paperlist = new ArrayList<Paper>();
		//instances of papers
		Paper oose = new Paper("159.407 OOSE");
		Paper project = new Paper("143.485 Engineering Project");
		paperlist.add(oose);
		paperlist.add(project);
		return paperlist;
	}
	
	
	
	public static ArrayList<College> collegeArrayList(){
		ArrayList<College> collegeList = new ArrayList<College>();
		//instances of colleges
		College c = new College("College of Sciences","Turitea",new Date(),12000.00);
		collegeList.add(c);
		c = new College("College of Education","Hokowhitu",new Date(),23000.00);
		return collegeList;
	
	}
	
	
	public static Object[] classHierarchy(){	  
      Object[] hierarchy = { "javax.swing",
        "javax.swing.border",
        "javax.swing.colorchooser",
        "javax.swing.event",
        "javax.swing.filechooser",
        new Object[] { "javax.swing.plaf",
                       "javax.swing.plaf.basic",
                       "javax.swing.plaf.metal",
                       "javax.swing.plaf.multi" },
        "javax.swing.table",
        new Object[] { "javax.swing.text",
                       new Object[] { "javax.swing.text.html",
                                      "javax.swing.text.html.parser" },
                       "javax.swing.text.rtf" },
        "javax.swing.tree",
        "javax.swing.undo" };
      return hierarchy;
	}

}
